#include "ros/ros.h"


int main(int argc, char *argv[])
{
    ros::init(argc, argv, "find");
    ros::NodeHandle nh;

    // find方式1：
    int ret = nh.param("nh_int", 0);
    ROS_INFO("nh_int: %d", ret);

    double val = 0;
    nh.getParam("nh_double", val);
    ROS_INFO("nh_double: %lf", val);

    nh.getParamCached("nh_double", val);
    ROS_INFO("nh_double: %lf", val);

    std::vector<std::string> v;
    nh.getParamNames(v);
    for(auto& s : v)
    {
        std::cout << s << " ";
    }
    std::cout << std::endl;

    if(nh.hasParam("nh_map"))
    {
        ROS_INFO("existed");
    }
    else
    {
        ROS_INFO("not existed");
    }

    std::string str;
    nh.searchParam("nh_vector", str);
    ROS_INFO("%s", str.c_str());

    std::vector<int> vv;
    ros::param::get("nh_vector", vv);
    for(auto& e : vv)
    {
        std::cout << e << std::endl;
    }
    return 0;
}
